using TechEd.Data.Core;
using TechEd.Data.Core.Entity;
using TechEd.RestService.DataLayer.Communication.Base;

namespace TechEd.RestService.DataLayer.Communication
{
	public class VideoInfoContext : EntityContext<VideoInfo>
	{
		public VideoInfoContext(string tablePrefix) : base(tablePrefix)
		{
		}

		public string UploadVideo(string name, byte[] bytes, string contextType)
		{
			string blobAddressUri = SaveFileToBlob(bytes, new[]
			                                              	{
			                                              		new MetaPair(MetaPair.FileName, name),
			                                              		new MetaPair(MetaPair.FileSize, bytes.Length.ToString()),
			                                              		new MetaPair(MetaPair.FileType, FileType.Video.Name()),
			                                              		new MetaPair(MetaPair.FileContentType, contextType)
			                                              	});

			
			return blobAddressUri;
		}
	}
}